<?php
/**
 * Created by PhpStorm.
 * User: chenxuyi
 * Date: 2018/1/22
 * Time: 下午2:59
 */

namespace App\Services;

use Qiniu\Auth;

class QiNiuService
{

    private $config = [];
    private $auth;

    public function __construct()
    {
        $this->config = config('qiniu');
        $this->auth   = new Auth($this->config['access_key'], $this->config['secret_key']);
    }

    public function uploadMusicToken()
    {
        $options = [];
        $token   = $this->auth->uploadToken($this->config['bucket'], null, 86400, $options);

        return $token;
    }

}